TECCreateSniffer
Creates a sniffer object and returns a reference to it.
pascal OSStatus TECCreateSniffer ( TECSnifferObjectRef *encodingSniffer, TextEncoding testEncodings[], ItemCount numTextEncodings);
encodingSniffer
- A pointer to a sniffer object reference, which is of type
TECSnifferObjectRef
(page 65). On output, the reference pertains to the newly created sniffer object.testEncodings[]
- An array of text encoding specifications supplied by the caller;
TECCreateSniffer
will attempt to create a sniffer that is capable of sniffing for each of these encodings.numTextEncodings
- A value of type
ItemCount
that specifies the number of text encoding specifications in thetestEncodings[]
array.- function result
- A result code. See "Text Encoding Conversion Manager Result Codes" (page 42) for a list of possible values. If other than
noErr
, then one of the text conversion plug-ins encountered an error when polled for available sniffers.DISCUSSION
TheTECCreateSniffer
function polls plug-ins for available sniffers, creates a sniffer object capable of sniffing each of the specified encodings that it can find a sniffer function for, and returns a reference to it. You use this sniffer object reference with sniffer functions such asTECSniffTextEncoding
(page 86). If no sniffer function is available for a particular encoding, no error is returned andTECSniffTextEncoding
indicates later that the encoding was not examined.To remove a sniffer object, you must call the function
TECDisposeSniffer
(page 89).SEE ALSO
The functionTECCountAvailableSniffers
(page 83)The function
TECGetAvailableSniffers
(page 84)